/*
 Navicat Premium Data Transfer

 Source Server         : 127.0.0.1
 Source Server Type    : SQL Server
 Source Server Version : 10501600
 Source Host           : 127.0.0.1:1433
 Source Catalog        : DMCAD
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 10501600
 File Encoding         : 65001

 Date: 01/05/2019 09:46:28
*/


-- ----------------------------
-- Table structure for category
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[category]') AND type IN ('U'))
	DROP TABLE [dbo].[category]
GO

CREATE TABLE [dbo].[category] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [name] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [code] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [status] varchar(1) COLLATE Chinese_PRC_CI_AS DEFAULT ((0)) NULL,
  [createtime] datetime  NULL,
  [updatetime] datetime  NULL
)
GO

ALTER TABLE [dbo].[category] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'category',
'COLUMN', N'id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'category',
'COLUMN', N'name'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编码',
'SCHEMA', N'dbo',
'TABLE', N'category',
'COLUMN', N'code'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态 0启用 1停用 9删除',
'SCHEMA', N'dbo',
'TABLE', N'category',
'COLUMN', N'status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'category',
'COLUMN', N'createtime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'category',
'COLUMN', N'updatetime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分类表',
'SCHEMA', N'dbo',
'TABLE', N'category'
GO


-- ----------------------------
-- Table structure for floorplan
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[floorplan]') AND type IN ('U'))
	DROP TABLE [dbo].[floorplan]
GO

CREATE TABLE [dbo].[floorplan] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [name] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [code] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [categoryId] int  NULL,
  [basic_border_color] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [basic_fill_color] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [rent_border_color] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [rent_fill_color] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [query_border_color] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [query_fill_color] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [anchor_point] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [size] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [status] int DEFAULT ((0)) NULL,
  [createtime] datetime  NULL,
  [updatetime] datetime  NULL
)
GO

ALTER TABLE [dbo].[floorplan] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'name'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编码，唯一识别一个平面图',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'code'
GO

EXEC sp_addextendedproperty
'MS_Description', N'所属分类',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'categoryId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'基础店铺边框色',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'basic_border_color'
GO

EXEC sp_addextendedproperty
'MS_Description', N'基础店铺填充色',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'basic_fill_color'
GO

EXEC sp_addextendedproperty
'MS_Description', N'租赁店铺边框色',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'rent_border_color'
GO

EXEC sp_addextendedproperty
'MS_Description', N'租赁店铺填充色',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'rent_fill_color'
GO

EXEC sp_addextendedproperty
'MS_Description', N'查询结果边框色',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'query_border_color'
GO

EXEC sp_addextendedproperty
'MS_Description', N'查询结果填充色',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'query_fill_color'
GO

EXEC sp_addextendedproperty
'MS_Description', N'参照点',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'anchor_point'
GO

EXEC sp_addextendedproperty
'MS_Description', N'尺寸比例',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'size'
GO

EXEC sp_addextendedproperty
'MS_Description', N'状态 0启用 1停用 9删除',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'status'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'createtime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'floorplan',
'COLUMN', N'updatetime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'平面图管理表',
'SCHEMA', N'dbo',
'TABLE', N'floorplan'
GO


-- ----------------------------
-- Table structure for graph
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[graph]') AND type IN ('U'))
	DROP TABLE [dbo].[graph]
GO

CREATE TABLE [dbo].[graph] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [floorplanId] int  NULL,
  [name] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [type] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [object] varchar(max) COLLATE Chinese_PRC_CI_AS  NULL,
  [area] int  NULL,
  [x] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [y] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [parameters] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [categoryId] int  NULL,
  [createtime] datetime  NULL,
  [updatetime] datetime  NULL,
  [width] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [height] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [code] varchar(200) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[graph] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'所属平面图',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'floorplanId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'name'
GO

EXEC sp_addextendedproperty
'MS_Description', N'类型',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'type'
GO

EXEC sp_addextendedproperty
'MS_Description', N'对象',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'object'
GO

EXEC sp_addextendedproperty
'MS_Description', N'面积',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'area'
GO

EXEC sp_addextendedproperty
'MS_Description', N'x坐标',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'x'
GO

EXEC sp_addextendedproperty
'MS_Description', N'y坐标',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'y'
GO

EXEC sp_addextendedproperty
'MS_Description', N'参数',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'parameters'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分类Id',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'categoryId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'createtime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'updatetime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'宽度',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'width'
GO

EXEC sp_addextendedproperty
'MS_Description', N'高度',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'height'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'graph',
'COLUMN', N'code'
GO

EXEC sp_addextendedproperty
'MS_Description', N'元素管理表',
'SCHEMA', N'dbo',
'TABLE', N'graph'
GO


-- ----------------------------
-- Table structure for subgraph
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[subgraph]') AND type IN ('U'))
	DROP TABLE [dbo].[subgraph]
GO

CREATE TABLE [dbo].[subgraph] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [floorplanId] int  NULL,
  [graphId] int  NULL,
  [classify] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [type] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [object] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [x] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [y] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [width] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [height] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [parameters] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [createtime] datetime  NULL,
  [updatetime] datetime  NULL
)
GO

ALTER TABLE [dbo].[subgraph] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'所属平面图',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'floorplanId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'元素表主键',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'graphId'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分类，前端应用的字段名',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'classify'
GO

EXEC sp_addextendedproperty
'MS_Description', N'类型',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'type'
GO

EXEC sp_addextendedproperty
'MS_Description', N'对象',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'object'
GO

EXEC sp_addextendedproperty
'MS_Description', N'x坐标',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'x'
GO

EXEC sp_addextendedproperty
'MS_Description', N'y坐标',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'y'
GO

EXEC sp_addextendedproperty
'MS_Description', N'宽度',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'width'
GO

EXEC sp_addextendedproperty
'MS_Description', N'高度',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'height'
GO

EXEC sp_addextendedproperty
'MS_Description', N'参数',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'parameters'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'createtime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'subgraph',
'COLUMN', N'updatetime'
GO

EXEC sp_addextendedproperty
'MS_Description', N'元素子表',
'SCHEMA', N'dbo',
'TABLE', N'subgraph'
GO


-- ----------------------------
-- Primary Key structure for table category
-- ----------------------------
ALTER TABLE [dbo].[category] ADD CONSTRAINT [PK_CATEGORY] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table floorplan
-- ----------------------------
ALTER TABLE [dbo].[floorplan] ADD CONSTRAINT [PK_FLOORPLAN] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table graph
-- ----------------------------
ALTER TABLE [dbo].[graph] ADD CONSTRAINT [PK_GRAPH] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO


-- ----------------------------
-- Primary Key structure for table subgraph
-- ----------------------------
ALTER TABLE [dbo].[subgraph] ADD CONSTRAINT [PK__subgraph__3213E83F0DAF0CB0] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

